package com.woniuxy.userassembly.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.common.PageResult;
import com.woniuxy.userassembly.model.RbacRole;
import com.woniuxy.userassembly.dao.RbacRoleMapper;
import com.woniuxy.userassembly.service.IRbacRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Liyfi
 * @since 2021-05-22
 */
@Service
public class RbacRoleServiceImpl extends ServiceImpl<RbacRoleMapper, RbacRole> implements IRbacRoleService {
    @Autowired
    private RbacRoleMapper mapper;

    @Override
    public int addRole(RbacRole role) {
        int i = mapper.addRole(role);
        return i;
    }



    @Override
    public int delRole(int roleId) {
        int i = mapper.delRole(roleId);

        return i;
    }

    @Override
    public int updRole(String roleName,int roleId) {
        int i = mapper.updRole(roleName,roleId);
        return i;
    }

    @Override
    public RbacRole findRoleById(int userId) {
        RbacRole role = mapper.selectById(userId);
        return role;
    }
}
